﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using FixtureManageSystem.ViewModels;
using FixtureManageSystem.Models;
using System.Data;
using System.Collections;
using System.Windows.Navigation;
using System.Windows.Input;

namespace FixtureManageSystem.Views
{
    /// <summary>
    /// WareHouseInView.xaml 的交互逻辑
    /// </summary>
    public partial class WareHouseIn : Page
    {
        public WareHouseIn()
        {
            this.DataContext = new WareHouseInViewMode();
            InitializeComponent();
            startTime.SelectedDate = null;
            startTime.DisplayDate = DateTime.Now;
            endTime.SelectedDate = null;
            endTime.DisplayDate = DateTime.Now;
        }

        private void dataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            WareHouseInViewMode whiViewMode = this.DataContext as WareHouseInViewMode;
            whiViewMode.Update();
            // 调用父类的方法
        }

        private void ComboBox_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
        {
            WareHouseInViewMode whiViewMode = this.DataContext as WareHouseInViewMode;
            whiViewMode.SearchText = this.PersonCombobox.Text;
            PersonCombobox.IsDropDownOpen = true;
            PersonCombobox.SelectedItem = null;
        }

        private void ComboBox_PreviewKeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {

        }
    }
}
